import instance from "./request";
// 封装 GET 请求
const get = (url, params = {}) => {
  return instance.get(url, { params });
};

// 封装 POST 请求
const post = (url, data = {}) => {
  return instance.post(url, data);
};

// 封装 PUT 请求
const put = (url, data = {}, config = {}) => {
  return instance.put(url, data, config);
};

// 封装 DELETE 请求
const del = (url, config = {}) => {
  return instance.delete(url, config);
};

export default {
  post,
  get,
  put,
  del,
};
